import HttpUtil from '@/common/HttpUtil'

const collectionApi = {
  /**
   * 新增参数
   * @param params
   * @returns {*}
   */
  addParam (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/param/addParam'
    return HttpUtil.postJSON(postUrl, params)
  },
  /**
   * 修改参数
   * @param params
   * @returns {*}
   */
  updateParam (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/param/updateParam'
    return HttpUtil.putJSON(postUrl, params)
  },
  /**
   * 获取单个参数
   * @param param
   * @returns {*}
   */
  getParam (param) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/param/getParam/' + param
    return HttpUtil.get(postUrl, null)
  },
  /**
   * 删除参数
   * @param param
   * @returns {*}
   */
  deleteParam (param) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/param/deleteParam/' + param
    return HttpUtil.delete(postUrl, null)
  },
  /**
   * 根据module获取参数列表
   * @param params
   * @returns {*}
   */
  findParamModule (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/param/findParamModule'
    return HttpUtil.post(postUrl, params)
  },
}
export default collectionApi
